package kevin.workplan.database.dao;

import java.util.List;

import kevin.workplan.database.gen.mapper.PlanMapper;
import kevin.workplan.database.gen.model.Plan;
import kevin.workplan.database.gen.model.PlanExample;

import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.type.JdbcType;

public interface CPlanMapper extends PlanMapper {
	
	@SelectProvider(type=CPlanSqlProvider.class, method="countByExample")
    int countByExample(PlanExample example);
	
	
	@SelectProvider(type=CPlanSqlProvider.class, method="searchByExampleWithBLOBs")
	@Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="uid", property="uid", jdbcType=JdbcType.BIGINT),
        @Result(column="bname", property="bname", jdbcType=JdbcType.VARCHAR),
        @Result(column="sname", property="sname", jdbcType=JdbcType.VARCHAR),
        @Result(column="title", property="title", jdbcType=JdbcType.VARCHAR),
        @Result(column="create_time", property="createTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="finish_time", property="finishTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="start_time", property="startTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="end_time", property="endTime", jdbcType=JdbcType.TIMESTAMP),
        @Result(column="progress", property="progress", jdbcType=JdbcType.INTEGER),
        @Result(column="priority", property="priority", jdbcType=JdbcType.INTEGER),
        @Result(column="content", property="content", jdbcType=JdbcType.LONGVARCHAR)
    })
    List<Plan> searchByExampleWithBLOBs(PlanExample example);
}
